using Script;
using Script.UI;
using UnityEngine;
using UnityEngine.UI;

public class InitUI : BaseUI
{
    public Button startBtn;
    public Button quitBtn;

    protected override void OnInit(params object[] args)
    {
        startBtn.onClick.AddListener(OnStartBtnClicked);
        quitBtn.onClick.AddListener(OnQuitBtnClicked);
        AudioMgr.Instance.PlayLoop("yu",1f);
    }
    
    protected override void OnDispose()
    {
        
    }
    
    protected override void OnOpen(params object[] args)
    {
        
    }
    
    protected override void OnClose()
    {
        
    }

    private void OnStartBtnClicked()
    {
        Debug.Log("点击 开始游戏");
        Close();
        UIMgr.Instance.OpenUI<JieDaiChuUI>();
        AudioMgr.Instance.PlayLoop("bgm",0.6f);
    }

    private void OnQuitBtnClicked()
    {
        Debug.Log("点击 退出游戏");
        Application.Quit();
    }
}
